/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Warehouse",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Domain.IServices;
using Microsoft.AspNetCore.Authorization;

namespace VOL.Domain.Controllers
{
    [AllowAnonymous]
    public partial class WarehouseController
    {
        private readonly IWarehouseService _warehouseService;

        public WarehouseController(IWarehouseService warehouseService)
        {
            _warehouseService = warehouseService;
        }

        [HttpPost("CreateWarehouse")]
        public async Task<int> CreateWarehouse([FromForm] Warehouse warehouse)
        {
            return await _warehouseService.CreateWarehouse(warehouse);
        }
        [HttpGet("GetWarehouse")]
        public async Task<List<Warehouse>> GetWarehouse()
        {
            return await _warehouseService.GetWarehouse();
        }
    }
}
